All Functions Used So Far, Week 5

data.frame

{base}

Create a data.frame from vectors

rnorm

{base}

Generate random numbers from a normal distribution

bar

{base}

Used for annotations, such as “expression(paste(”-“,bar(y)))”

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

dnorm

{stats}

Density distribution for the normal distribution

median

{stats}

Get median of a vector

factor

{base}

Create a factor

head

{utils}

Show first 5 rows of a data frame

ungroup

{dplyr}

Resolve grouping created with “group_by”

names

{base}

Get or set names of an object

colMeans

{base}

Computes the means of each column of a numeric matrix or data frame

library

{base}

Load an R package

mean

{base}

Get mean of a vector

plot

{graphics}

Generic function from base R to produce a plot

factor

{base}

Create factor variables

seq

{base}

Create a sequence

str

{utils}

Get the structure of an R object

mutate

{dplyr}

Create new variables

quantile

{stats}

Obtain empirical quantiles of a vector

arrange

{dplyr}

Sort values of data frame according to a variable/combination of variables

min

{base}

Get minimum of a vector

log

{base}

log (default base = e)

is.na

{base}

Check if a value is NA/elements of vector are NA

which

{base}

return indexes of TRUE entries of a logical vector

complete.cases

{stats}

Find Complete Cases

lm

{stats}

Fit linear models using least squares

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

filter

{dplyr}

Filter out rows of a data frame according to logical vector

expression

{base}

Used in plots to add symbols to axes

nobs

{stats}

Return the number of observations in a model object

scale_color_manual

{ggplot2}

Manually sets the colours used in a ggplot color scale to user-specified values

as.character

{base}

Coerce a vector to character

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

order

{base}

Get indexes that will sort a vector

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

modelsummary

{modelsummary}

Creates regression and data tables

max

{base}

Get maximum of a vector

group_tt

{tinytable}

Grouping in tinytable

binomial

{base}

Family argument in glm()

list

{base}

Create a list object

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

range

{base}

Return range of values

sample

{base}

Takes a sample of the specified size

predict

{stats}

Generate predicted values from model objects

c

{base}

Combine values/vectors into a vector

par

{graphics}

Set parameters of the plotting device

length

{base}

Returns number of elements in an object

read_excel

{readxl}

Read an Excel file

ifelse

{base}

Return a or b depending on the value of test

sd

{stats}

Get standard deviation of a vector

glm

{base}

Fits generalized linear models

summary

{base}

Obtain summary statistics or detailed regression output

pnorm

{base}

Returns the cumulative distribution function (CDF) of the normal distribution

cut

{base}

Convert Numeric to Factor

ordered

{dplyr}

Create an ordered factor

rm

{base}

Remove objects

nrow

{base}

Get number of rows of a data frame

tibble

{tibble}

A modern data frame from the tidyverse

var

{stats}

Calculate variance

setwd

{base}

Set Working Directory

The end!